import wzh.beauties.PageManager as PM
import wzh.beauties.PageHandler as PH
class FetchController:
    __pm=PM.PageManager()
    __ph=PH.PageHandler()
    
    def start(self,initUrl):
        self.__pm=PM.PageManager()
        self.__pm.addPageUrl(initUrl)
        
        while True:
            page=self.__pm.getPage()
            if page==None:
                print("Fetching Is Done")
                break
            linkedPageUrls=self.__ph.handle(page)
            self.__pm.addPageUrls(linkedPageUrls)